1. Field of the Invention
The present invention generally relates to a method for motion pixel detection and, more particularly, to a method for motion pixel detection with adaptive thresholds so as to correctly evaluate whether a missing pixel is in a static region or in a non-static region, thereby reconstructing the missing pixel by an inter-field interpolation process or an intra-field interpolation process, respectively.
2. Description of the Prior Art
In the prior art, a motion-adaptive algorithm is used to reconstruct a missing pixel based on whether the missing pixel locates in a static region or a non-static region. More particularly, if the missing pixel is evaluated to locate in a static region, an inter-field interpolation process is exploited to reconstruct the missing pixel by referring to the information in the neighboring fields; on the other hand, if the missing pixel is evaluated to locate in a non-static region, then intra-field interpolation process is employed to reconstruct the missing pixel by referring to the information in the neighboring original scan lines of the same field.
Please refer to FIG. 1A, which is a schematic diagram showing an inter-field interpolation process in the prior art. As shown in FIG. 1A, a missing pixel 10 denoted by the “X” symbol is to be interpolated and is in the field F(n), while the preceding pixel 11 and the next pixel 13 are both denoted as “O” and are the original pixels in the fields F(n−1) and F(n+1), respectively. The coordinates of these three pixels are expressed as (x,y). The missing pixel 10 and the neighboring pixels 11 and 13 are at different time instance. Therefore, in the inter-field interpolation process, the missing pixel 10 is reconstructed by averaging the value of pixel 111 and the value of pixel 13, that is:
                    X        =                              [                                          F                ⁡                                  (                                      x                    ,                    y                    ,                                          n                      -                      1                                                        )                                            +                              F                ⁡                                  (                                      x                    ,                    y                    ,                                          n                      +                      1                                                        )                                                      ]                    2                                    (                  EQ          .                                          ⁢          1                )            wherein F(x,y,n−1) is the expression for the preceding pixel 11 and F(x,y,n+1) is the expression for the next pixel 13.
Please further refer to FIG. 1B, which is a schematic diagram showing an intra-field interpolation process in the prior art. As shown in FIG. 1B, a missing pixel 10 denoted by the “X” symbol is to be interpolated and is in the field F(n), while the pixel 14 and the pixel 16 are both denoted as “O” and are the original pixels in the same field F(n). The coordinates of the first pixel 14, the missing pixel 10 and the second pixel 16 are expressed as (x,y−1), (x,y), and (x,y+1), respectively. The missing pixel 10, the first pixel 14 and the second pixel 16 are at different locations in the y-orientation. Therefore, in the intra-field interpolation process the missing pixel 10 is reconstructed by averaging the value of pixel 14 and the value of pixel 16, that is:
                    X        =                              [                                          F                ⁡                                  (                                      x                    ,                                          y                      -                      1                                        ,                    n                                    )                                            +                              F                ⁡                                  (                                      x                    ,                                          y                      +                      1                                        ,                    n                                    )                                                      ]                    2                                    (                  EQ          .                                          ⁢          2                )            wherein F(x,y−1,n) is the expression for the first pixel 14 and F(x,y+1,n) is the expression for the second pixel 16.
To evaluate whether the missing pixel 10 locates in a static region or in a non-static region, the difference of the surrounding regions in the neighboring fields is calculated. If the difference is smaller than a threshold, the region surrounding the missing pixel 10 is recognized as a static region, implying the missing pixel 10 is in a static region. Whereas, if the difference is larger than the threshold, the region surrounding the missing pixel 10 is recognized as a non-static region, implying the missing pixel 10 is in a non-static region.
To calculate the difference between the surrounding regions in the neighboring fields, a conventional method referred to as the sum of absolute difference (SAD) is employed. Please refer to FIG. 2, which is a schematic diagram showing the conventional method. As shown in FIG. 2, a missing pixel 20 denoted by the “X” symbol is to be interpolated and is in the field F(n), while a plurality of neighboring pixels, denoted as “O”, are the original pixels in the fields F(n−1) 21 and F(n+1) 23. Therefore, the missing pixel 20 can be reconstructed by employing the inter-field interpolation process as shown in FIG. 1A and the intra-field interpolation process as shown in FIG. 1B. More particularly, the region difference “Diff(x,y,n)” is given by:
                              Diff          ⁡                      (                          x              ,              y              ,              n                        )                          =                              ∑                                          (                                  i                  ,                  j                                )                            ∈              Γ                                ⁢                                                                f                ⁡                                  (                                      i                    ,                    j                    ,                                          n                      -                      1                                                        )                                            -                              f                ⁡                                  (                                      i                    ,                    j                    ,                                          n                      +                      1                                                        )                                                                                                    (                  EQ          .                                          ⁢          3                )            where F(.) denotes the original pixels, andΓ={(x,y−2),(x,y+2),(x−1,y),(x+1,y)}.
It is noted that Σ|f(i,j,n−1)−f(i,j,n+1)| is the sum of absolute difference between the original pixels in the fields f(n−1) 21 and f(n+1) 23. More particularly, f(i,j,n−1) denotes the pixels in the field F(n−1) 21, while f(i,j,n+1) denotes the pixels in the field F(n+1) 23. Furthermore, (i,j) represents the locations of the pixels at the coordinates of, (x,y−2), (x,y), (x,y+2), (x−1,y), and (x+1,y).
The related art of the motion-adaptive de-interlacing algorithm is presented by a flow chart shown in FIG. 3. To begin with, field F(n) is to be de-interlaced (step 301). A de-interlacing processor inputs the current field F(n), the preceding field F(n−1), and the next field F(n+1) (step 303). After that, the missing pixels in field F(n) is scanned and interpolated in the raster order, from top-left to bottom-right (step 305). In order to evaluate whether the region surrounding a missing pixel is a static region or not, the region difference Diff is calculated (step 307) and then compared with a threshold (step 309). If the difference Diff is smaller than the threshold, the missing pixel is reconstructed by using the inter-field interpolation process as discussed with reference to FIG. 1A (step 311); otherwise, if the difference Diff is larger than or equal to the threshold, then the missing pixel is reconstructed by using the intra-field interpolation process as discussed with reference to FIG. 1B (step 313). After that, the de-interlaced pixel is output (step 315) and whether the pixel scanning process has reached the end of field F(n) is evaluated (step 317). If yes, the field F(n) is stopped being de-interlaced (step 319); otherwise, the procedure returns to step 305 and these static region detection and interpolation processes repeat until all the missing pixels in field F(n) have been reconstructed.
Even though the afore-mentioned motion-adaptive de-interlacing algorithm is easy to implement, the evaluation of a static region or a non-static region using a fixed threshold may only reflect the localized motion information to that region. This may, in turn, lead to a wrong evaluation if the region contains noise, such as those caused by the data format conversion. In other words, the difference between regions in the two neighboring fields that contain noise may be larger than the threshold. Consequently, the intra-field interpolation process would be used to reconstruct the missing pixels, which locate in a static region and should be reconstructed using the inter-field interpolation process. In the case that only some sparse pixels in the static region are reconstructed using the intra-field interpolation process, the reconstruction errors would be hardly recognizable. However, if a group of pixels in the static region are reconstructed using the intra-field interpolation process, the reconstruction errors could result in some very noticeable flickering artefacts.
Therefore, there is a need to provide a method for motion pixels detection with adaptive thresholds so as to correctly evaluate whether a missing pixel is in a static region or in a non-static region.